package com.wxb.cardmis.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * All rights Reserved, Designed By www.super-master.cn
 *
 * @ProjectName: getData
 * @Package: com.data.get.config
 * @ClassName: Crosconfig
 * <p> </p>
 * @Author: [Wei Xiao]
 * @Date: 2022/2/24 0:02
 * @Version: V1.0
 * @Copyright: 2022  com.wei All rights reserved.
 * TODO: 注意,本文件Wei Xiao所作,如果转载或使用请标明具体出处!
 * @Date: 2022年02月24日 0:02
 * @Description: []
 **/
@Configuration
public class Crosconfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("http://localhost:8080/")
                .allowedMethods("POST","GET","PUT","OPTIONS","DELETE")
                .maxAge(3600)
                .allowCredentials(true);
    }
}
